using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class ManufacturerMap : EntityTypeConfiguration<Manufacturer>
    {
        public ManufacturerMap()
        {
            // Primary Key
            this.HasKey(t => t.MF_ID);

            // Properties
            this.Property(t => t.MF_Name)
                .HasMaxLength(50);

            this.Property(t => t.MF_Remark)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Manufacturer");
            this.Property(t => t.MF_ID).HasColumnName("MF_ID");
            this.Property(t => t.MF_Name).HasColumnName("MF_Name");
            this.Property(t => t.MF_Remark).HasColumnName("MF_Remark");
        }
    }
}
